package event

import (
	"log"
	"rhelper"
	"time"
)

func SaveRelayEvent(cid string, ev string, evType string) {
	rconn := rhelper.Pool().Get()
	defer rconn.Close()

	t := time.Now().UTC()
	evmsg := t.Format("20060102150405") + ":" + ev + ":" + evType

	_, err := rconn.Do("RPUSH", rhelper.EVRelay+cid, evmsg)
	if err != nil {
		log.Println("SaveRelayEvent err:", err)
	}
}
